package com.coderdream.chapter17.observer.sample;

import java.util.Random;

public class RandomNumberGenerator extends NumberGenerator {
	
	private Random random = new Random();//隨機數產生器

	private int number;//目前數值
	
	@Override
	public void execute() {
		for (int i = 0; i < 10; i++) {
			number = random.nextInt(50);
			notifyObservers();
		}
		
		
	}

	@Override
	public int getNumber() {
		return number;
	}

}
